package com.huanying.framework.payment;

import java.sql.Timestamp;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.huanying.framework.user.User;

@Entity
@Table(name="trade_money")
public class Trade_Money {
	private static final long serialVersionUID = -2697936683291150264L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name="id")
	private int id;
	
	/*@OneToOne(cascade = { CascadeType.ALL })
	@JoinColumn(name = "user_id")
	private User user; // 发布人
*/	//private int user_id;
	@OneToOne(cascade = { CascadeType.ALL })
	@JoinColumn(name = "user_id")
	private User user; //用户
	@OneToOne(cascade = { CascadeType.ALL })
	@JoinColumn(name = "userobject_id")
	private User userobject; //交易伙伴
	//private int userobject_id;
	private double amount;//每次的交易额
	private Timestamp transactiontime;
	@Column(name="direction",nullable=false,columnDefinition="INT default 1")
	private int direction;		//状态   1支出 2收入
	private int type;//交易类型  1平台内交易 2平台外交易
	private Timestamp create_time;//生成时间
	private int bankType;//1微信 0其他
	@Column(name="status",nullable=false,columnDefinition="INT default 1")
	private int status;		//状态.  0停用  1正常
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	
	public double getAmount() {
		return amount;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public User getUserobject() {
		return userobject;
	}
	public void setUserobject(User userobject) {
		this.userobject = userobject;
	}
	public void setAmount(double amount) {
		this.amount = amount;
	}

	public int getDirection() {
		return direction;
	}
	public Timestamp getTransactiontime() {
		return transactiontime;
	}
	public void setTransactiontime(Timestamp transactiontime) {
		this.transactiontime = transactiontime;
	}
	public Timestamp getCreate_time() {
		return create_time;
	}
	public void setCreate_time(Timestamp create_time) {
		this.create_time = create_time;
	}
	public void setDirection(int direction) {
		this.direction = direction;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}

	public int getBankType() {
		return bankType;
	}
	public void setBankType(int bankType) {
		this.bankType = bankType;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
}
